import { createBrowserRouter } from 'react-router-dom'
import App from '../App.jsx'
import Login from '../pages/login/Login.jsx'
// 用户管理
import Home from '../pages/home/Home.jsx'
import UserList from '../pages/home/userList/index.jsx'
// 权限管理
import Permislistbox from '../pages/permissions/index.jsx'
import Rolelist from '../pages/permissions/roleList/index.jsx'
import Permislist from '../pages/permissions/permislist/index.jsx'



export const tworouter = [
    {
        path: '/home',
        element: <Home></Home>,
        title:'用户管理',
        children:[
            {
                path:'/home/userlist',
                element:<UserList></UserList>,
                title:'用户列表',
            }
        ]
    },
    {
        path:'/permislist',
        element:<Permislistbox></Permislistbox>,
        title:'权限管理',
        children:[
            {
                path:'/permislist/rolelist',
                element:<Rolelist></Rolelist>,
                title:'角色列表',
            },
            {
                path:'/permislist/permislist',
                element:<Permislist></Permislist>,
                title:'权限列表',
            }
        ]
    }
]

const router = createBrowserRouter([
    {
        path: '/',
        element: <App></App>,
        children: tworouter
    },
    {
        path: '/login',
        element: <Login></Login>
    }
])

export default router